home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume29 / zsh2.2 / part03 < prev    next >
Encoding:
Text File  |  1992-05-13  |  49.2 KB  |  1,915 lines

  1. Newsgroups: comp.sources.misc
  2. From: pfalstad@phoenix.Princeton.EDU (Paul Falstad)
  3. Subject:  v29i099:  zsh2.2 - The Z shell, Part03/17
  4. Message-ID: <1992May13.155507.8157@sparky.imd.sterling.com>
  5. X-Md4-Signature: 65c71c4552876273adb5ceffe88a0ed0
  6. Date: Wed, 13 May 1992 15:55:07 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: pfalstad@phoenix.Princeton.EDU (Paul Falstad)
  10. Posting-number: Volume 29, Issue 99
  11. Archive-name: zsh2.2/part03
  12. Environment: BSD
  13. Supersedes: zsh2.1: Volume 24, Issue 1-19
  14.  
  15. #!/bin/sh
  16. # this is aa.03 (part 3 of zsh2.2)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file zsh2.2/func/randline continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 3; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping zsh2.2/func/randline'
  34. else
  35. echo 'x - continuing file zsh2.2/func/randline'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'zsh2.2/func/randline' &&
  37. Xinteger z=$(wc -l <$1)
  38. Xsed -n $[RANDOM%z+1]p $1
  39. SHAR_EOF
  40. echo 'File zsh2.2/func/randline is complete' &&
  41. chmod 0755 zsh2.2/func/randline ||
  42. echo 'restore of zsh2.2/func/randline failed'
  43. Wc_c="`wc -c < 'zsh2.2/func/randline'`"
  44. test 80 -eq "$Wc_c" ||
  45.     echo 'zsh2.2/func/randline: original size 80, current size' "$Wc_c"
  46. rm -f _shar_wnt_.tmp
  47. fi
  48. # ============= zsh2.2/func/yp ==============
  49. if test -f 'zsh2.2/func/yp' -a X"$1" != X"-c"; then
  50.     echo 'x - skipping zsh2.2/func/yp (File already exists)'
  51.     rm -f _shar_wnt_.tmp
  52. else
  53. > _shar_wnt_.tmp
  54. echo 'x - extracting zsh2.2/func/yp (Text)'
  55. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/func/yp' &&
  56. X#! /bin/sh
  57. Xypmatch $1 passwd
  58. SHAR_EOF
  59. chmod 0755 zsh2.2/func/yp ||
  60. echo 'restore of zsh2.2/func/yp failed'
  61. Wc_c="`wc -c < 'zsh2.2/func/yp'`"
  62. test 29 -eq "$Wc_c" ||
  63.     echo 'zsh2.2/func/yp: original size 29, current size' "$Wc_c"
  64. rm -f _shar_wnt_.tmp
  65. fi
  66. # ============= zsh2.2/func/yu ==============
  67. if test -f 'zsh2.2/func/yu' -a X"$1" != X"-c"; then
  68.     echo 'x - skipping zsh2.2/func/yu (File already exists)'
  69.     rm -f _shar_wnt_.tmp
  70. else
  71. > _shar_wnt_.tmp
  72. echo 'x - extracting zsh2.2/func/yu (Text)'
  73. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/func/yu' &&
  74. X#! /bin/sh
  75. Xypmatch $1 passwd.byuid
  76. SHAR_EOF
  77. chmod 0755 zsh2.2/func/yu ||
  78. echo 'restore of zsh2.2/func/yu failed'
  79. Wc_c="`wc -c < 'zsh2.2/func/yu'`"
  80. test 35 -eq "$Wc_c" ||
  81.     echo 'zsh2.2/func/yu: original size 35, current size' "$Wc_c"
  82. rm -f _shar_wnt_.tmp
  83. fi
  84. # ============= zsh2.2/man/man1/zsh.1 ==============
  85. if test ! -d 'zsh2.2/man'; then
  86.     echo 'x - creating directory zsh2.2/man'
  87.     mkdir 'zsh2.2/man'
  88. fi
  89. if test ! -d 'zsh2.2/man/man1'; then
  90.     echo 'x - creating directory zsh2.2/man/man1'
  91.     mkdir 'zsh2.2/man/man1'
  92. fi
  93. if test -f 'zsh2.2/man/man1/zsh.1' -a X"$1" != X"-c"; then
  94.     echo 'x - skipping zsh2.2/man/man1/zsh.1 (File already exists)'
  95.     rm -f _shar_wnt_.tmp
  96. else
  97. > _shar_wnt_.tmp
  98. echo 'x - extracting zsh2.2/man/man1/zsh.1 (Text)'
  99. sed 's/^X//' << 'SHAR_EOF' > 'zsh2.2/man/man1/zsh.1' &&
  100. X.\"
  101. X.TH ZSH 1 "1992 May 2"
  102. X.SH NAME
  103. Xzsh \- the Z shell
  104. X.SH SYNOPSIS
  105. X\fBzsh\fP [ \(+-\fIoptions\fP ] [ \(+-\fBo\fP \fIoption\fP ] ...  [ \-\fBc\fP \fIstring\fP ] [ \fIarg\fP ... ]
  106. X.SH "SHELL GRAMMAR"
  107. XA \fIsimple command\fP is a sequence of optional parameter
  108. Xassignments followed by blank-separated words,
  109. Xwith optional redirections interspersed.
  110. XThe first word is the command to be executed, and the remaining
  111. Xwords, if any, are arguments to the command.
  112. XIf a command name is given, the parameter assignments modify
  113. Xthe environment of the command when it is executed.
  114. XThe value of a simple command is its exit status,
  115. Xor 128 plus the signal number if terminated by a signal.
  116. X.PP
  117. XIf a simple command is preceded by the word \fBexec\fP,
  118. Xit is executed in the parent shell without forking.
  119. XIf preceded by \fBcommand\fP, the command word is taken
  120. Xto be the name of an external command, rather than a
  121. Xshell function or builtin.
  122. XIf preceded by \fBnoglob\fP, filename generation is not performed
  123. Xon any of the words.  If preceded by a \-, the command
  124. Xis executed with a \- prepended to its \fBargv[0]\fP string.
  125. XIf preceded by \fBnocorrect\fP, spelling correction is not
  126. Xdone on any of the words.
  127. X.PP
  128. XA \fIpipeline\fP is a sequence of one or more commands
  129. Xseparated by \fB|\fP or \fB|&\fP.  \fB|&\fP is shorthand
  130. Xfor \fB2>&1 |\fP.  The standard output of each command is
  131. Xconnected to the standard input of the next command in the
  132. Xpipeline.
  133. X.PP
  134. XThe value of a pipeline is the value of the last command.
  135. XIf a pipeline is preceded by a \fB!\fP, the value
  136. Xof that pipeline is the logical NOT of the value of the last
  137. Xcommand.
  138. X.PP
  139. XIf a pipeline is preceded by \fBcoproc\fP, it is
  140. Xexecuted as a coprocess; a two-way pipe is established
  141. Xbetween it and the parent shell.  The shell can read from or write to
  142. Xthe coprocess by means of the \fB>&p\fP and \fB<&p\fP
  143. Xredirection operators.
  144. X.PP
  145. XA \fIsublist\fP is a sequence of one or more pipelines
  146. Xseparated by \fB&&\fP or \fB|\||\fP.  If two pipelines
  147. Xare separated by \fB&&\fP, the second pipeline is executed
  148. Xonly if the first is successful (returns a zero value).
  149. XIf two pipelines are separated by \fB|\||\fP, the second is executed
  150. Xonly if the first is unsuccessful (returns a nonzero value).
  151. X.PP
  152. XA \fIlist\fP is a sequence of one or more sublists
  153. Xseparated by, and optionally terminated by, \fB;\fP, \fB&\fP,
  154. Xor a newline.
  155. XNormally the shell waits for each list to finish before executing
  156. Xthe next one.
  157. XIf a list is terminated by a \fB&\fP, the shell executes
  158. Xit in the background, and does not wait for it to finish.
  159. X.PP
  160. XA \fIcomplex command\fP is one of the following:
  161. X.PP
  162. X.RS
  163. X.PD 0
  164. X.TP
  165. X\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ... ]
  166. X.TP
  167. X\fBdo\fP \fIlist\fP
  168. X.TP
  169. X\fBdone\fP
  170. X.PD
  171. XExpand the list of \fIword\fPs, and set the parameter
  172. X\fIname\fP to each of them in turn, executing
  173. X\fIlist\fP each time.  If the \fBin\fP \fIword\fP is omitted,
  174. Xuse the positional parameters instead of the \fIword\fPs.
  175. X.TP
  176. X\fBfor\fP \fIname\fP [ \fBin\fP \fIword\fP ... ] ; \fIsublist\fP
  177. XThis is a shorthand for \fBfor\fP.
  178. XThough it may cause confusion, it is included for convenience;
  179. Xits use in scripts is discouraged,
  180. Xunless \fIsublist\fP is a command of the form { \fIlist\fP }.
  181. X.PP
  182. X.PD 0
  183. X.TP
  184. X\fBforeach\fP \fIname\fP \fB(\fP \fIword\fP ... \fB)\fP
  185. X.TP
  186. X\fIlist\fP
  187. X.TP
  188. X\fBend\fP
  189. X.PD
  190. XAnother form of \fBfor\fP.
  191. X.PP
  192. X.PD 0
  193. X.TP
  194. X\fBfor\fP \fIname\fP \fBin\fP \fIword\fP ...
  195. X.TP
  196. X\fB{\fP
  197. X.TP
  198. X\fIlist\fP
  199. X.TP
  200. X\fB}\fP
  201. X.PD
  202. XAnother form of \fBfor\fP.
  203. X.PP
  204. X.PD 0
  205. X.TP
  206. X\fBfor\fP \fIname\fP \fB(\fP \fIword\fP ... \fB) {\fP
  207. X.TP
  208. X\fIlist\fP
  209. X.TP
  210. X\fB}\fP
  211. X.PD
  212. XAnother form of \fBfor\fP.
  213. X.PP
  214. X.PD 0
  215. X.TP
  216. X\fBfor\fP \fIname\fP \fB(\fP \fIword\fP ... \fB) \fIsublist\fP
  217. X.PD
  218. XAnother form of \fBfor\fP.
  219. X.PP
  220. X.PD 0
  221. X.TP
  222. X\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ... ]
  223. X.TP
  224. X\fBdo\fP \fIlist\fP
  225. X.TP
  226. X\fBdone\fP
  227. X.PD
  228. XPrint the set of \fIword\fPs, each preceded by a number.
  229. XIf the \fBin\fP \fIword\fP is omitted, use the positional parameters.
  230. XThe \fBPROMPT3\fP prompt is printed and a line is read from standard
  231. Xinput.  If this line consists of the number of one of the listed
  232. X\fIword\fPs, then the parameter \fIname\fP
  233. Xis set to the \fIword\fP corresponding to this number.
  234. XIf this line is empty, the selection list is printed again.
  235. XOtherwise, the value of the parameter \fIname\fP is set to null.
  236. XThe contents of the line read from standard input is saved
  237. Xin the parameter \fBREPLY\fP.  \fIlist\fP is executed
  238. Xfor each selection until a break or end-of-file is encountered.
  239. X.TP
  240. X\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP ] ; \fIsublist\fP
  241. XA short form of \fBselect\fP.
  242. X.TP
  243. X\fBcase\fP \fIword\fP \fBin\fP [ \fIpattern\fP ) \fIlist\fP ;; ] ...  \fBesac\fP
  244. XExecute the \fIlist\fP associated with the first \fIpattern\fP
  245. Xthat matches \fIword\fP, if any.  The form of the patterns
  246. Xis the same as that used for filename generation.  See
  247. X\fIFilename Generation\fP below.
  248. X.TP
  249. X\fBcase\fP \fIword\fP \fB{\fP [ \fIpattern\fP ) \fIlist\fP ;; ] ...  \fB}\fP
  250. XAnother form of \fBcase\fP.
  251. X.TP
  252. X.PD 0
  253. X\fBif\fP \fIlist\fP
  254. X.TP
  255. X\fBthen\fP \fIlist\fP
  256. X.TP
  257. X[ \fBelif\fP \fIlist\fP ; \fBthen\fP \fIlist\fP ] ...
  258. X.TP
  259. X[ \fBelse\fP \fIlist\fP ]
  260. X.TP
  261. X\fBfi\fP
  262. X.PD
  263. XThe \fBif\fP \fIlist\fP is executed, and,
  264. Xif it returns a zero exit status,
  265. Xthe \fBthen\fP \fIlist\fP is executed.
  266. XOtherwise, the \fBelif\fP \fIlist\fP is
  267. Xexecuted and, if its value is zero,
  268. Xthe \fBthen\fP \fIlist\fP is executed.
  269. XIf each \fBelif\fP \fIlist\fP returns
  270. Xnonzero, the \fBelse\fP \fIlist\fP is executed.
  271. X.TP
  272. X\fBif (\fP \fIlist\fP \fB)\fP \fIsublist\fP
  273. XA short form of \fBif\fP.
  274. X.PP
  275. X.PD 0
  276. X.TP
  277. X\fBif\fP \fB(\fP \fIlist\fP \fB) {\fP
  278. X.TP
  279. X\fIlist\fP
  280. X.TP
  281. X\fB} elif (\fP \fIlist\fP \fB) {\fP
  282. X.TP
  283. X\fIlist\fP
  284. X.TP
  285. X\fB} ... else {\fP
  286. X.TP
  287. X\fIlist\fP
  288. X.TP
  289. X\fB}\fP
  290. X.PD
  291. XAn alternate form of \fBif\fP.
  292. X.TP
  293. X.PD 0
  294. X\fBwhile\fP \fIlist\fP
  295. X.TP
  296. X\fBdo\fP \fIlist\fP
  297. X.TP
  298. X\fBdone\fP
  299. X.PD
  300. XExecute the \fBdo\fP \fIlist\fP as long as the \fBwhile\fP \fIlist\fP
  301. Xreturns a zero exit status.
  302. X.PP
  303. X.PD 0
  304. X.TP
  305. X\fBwhile (\fP \fIlist\fP \fB) {\fP
  306. X.TP
  307. X\fIlist\fP
  308. X.TP
  309. X\fB}\fP
  310. X.PD
  311. XAn alternate form of \fBwhile\fP.
  312. X.TP
  313. X.PD 0
  314. X\fBuntil\fP \fIlist\fP
  315. X.TP
  316. X\fBdo\fP \fIlist\fP
  317. X.TP
  318. X\fBdone\fP
  319. X.PD
  320. XExecute the \fBdo\fP \fIlist\fP as long as \fBuntil\fP \fIlist\fP
  321. Xreturns a nonzero exit status.
  322. X.TP
  323. X.PD 0
  324. X\fBrepeat\fP \fIword\fP
  325. X.TP
  326. X\fBdo\fP \fIlist\fP
  327. X.TP
  328. X\fBdone\fP
  329. X.PD
  330. X\fIword\fP is expanded and treated as an arithmetic expression,
  331. Xwhich must evaluate to a number \fIn\fP.
  332. X\fIlist\fP is then executed \fBn\fP times.
  333. X.TP
  334. X\fBrepeat\fP \fIword\fP \fIsublist\fP
  335. XThis is a short form of \fBrepeat\fP.
  336. X.TP
  337. X( \fIlist\fP )
  338. XExecute \fIlist\fP in a subshell.
  339. X.TP
  340. X{ \fIlist\fP }
  341. XExecute \fIlist\fP.
  342. X.TP
  343. X.PD 0
  344. X\fBfunction\fP \fIword\fP [ (\|) ] ... { \fIlist\fP }
  345. X.TP
  346. X\fIword\fP ... (\|) { \fIlist\fP }
  347. X.TP
  348. X\fIword\fP ... (\|) \fIsublist\fP
  349. X.PD
  350. XDefine a function which is referenced by any one of \fIword\fP.
  351. XNormally, only one \fIword\fP is provided; multiple \fIword\fPs
  352. Xare usually only useful for setting traps.
  353. XThe body of the function is the \fIlist\fP between
  354. Xthe { and }.
  355. XSee \fBFUNCTIONS\fP below.
  356. X.TP
  357. X\fBtime\fP [ \fIpipeline\fP ]
  358. XThe \fIpipeline\fP is executed, and timing statistics are
  359. Xreported on the standard error in the form specified
  360. Xby the \fBTIMEFMT\fP parameter.
  361. XIf \fIpipeline\fP is omitted, print statistics about the
  362. Xshell process and its children.
  363. X.TP
  364. X[[ \fIexp\fP ]]
  365. XEvaluates the conditional expression \fIexp\fP
  366. Xand return a zero exit status if it is true.
  367. XSee \fBConditional Expressions\fP below for a description
  368. Xof \fIexp\fP.
  369. X.SH "RESERVED WORDS"
  370. XThe following words are recognized as reserved words when used 
  371. Xas the first word of a command
  372. Xunless quoted or removed using the \fBunalias\fP builtin:
  373. X.RS
  374. X.PP
  375. X\fBdo done esac then elif else fi for case
  376. Xif while function repeat time until exec command
  377. Xselect coproc noglob \- nocorrect foreach end\fP
  378. X.RE
  379. X.SH COMMENTS
  380. XIn noninteractive shells, or in interactive shells with the
  381. X\fBINTERACTIVE_COMMENTS\fP option set, a word beginning
  382. Xwith the third character of the \fBHISTCHARS\fP parameter
  383. X(`#' by default) causes that word and all the following
  384. Xcharacters up to a newline to be ignored.
  385. X.SH ALIASING
  386. XEvery token in the shell input is checked to see if there
  387. Xis an alias defined for it.
  388. XIf so, it is replaced by the text of the alias if it is in command
  389. Xposition (if it could be the first word of a simple command),
  390. Xor if the alias is global.
  391. XIf the text ends with a space, the next word in the shell input
  392. Xis treated as though it were in command position for purposes of alias
  393. Xexpansion.
  394. XAn alias is defined using the \fBalias\fP builtin; global aliases
  395. Xmay be defined using the \-\fBg\fP option to that bulitin.
  396. X.PP
  397. XAlias substitution is done on the shell input before any
  398. Xother substitution except history substitution.  Therefore,
  399. Xif an alias is defined for the word \fBfoo\fP, alias substitution
  400. Xmay be avoided by quoting part of the word, e.g. \fB\efoo\fP.
  401. XBut there is nothing to prevent an alias being defined
  402. Xfor \fB\efoo\fP as well.
  403. X.SH QUOTING
  404. XA character may be \fIquoted\fP (that is, made
  405. Xto stand for itself) by preceding it with a \e\|.
  406. X\e followed by a newline is ignored.
  407. XAll characters enclosed between a pair of single quotes ('')
  408. Xare quoted.
  409. XA single quote cannot appear within single quotes.
  410. XInside double quotes (""), parameter and command substitution
  411. Xoccurs, and \e quotes the characters \e\|, `, ", and $.
  412. X.SH EXPANSION
  413. XExpansion is performed on the command line after it has been
  414. Xparsed.  The types of expansions performed are
  415. X\fIfilename expansion\fP, 
  416. X\fIprocess substitution\fP,
  417. X\fIparameter expansion\fP,
  418. X\fIcommand substitution\fP,
  419. X\fIarithmetic expansion\fP,
  420. X\fIbrace expansion\fP,
  421. Xand \fIfilename generation\fP.
  422. X.SS Filename Expansion
  423. XEach word is checked to see if it begins with an unquoted ~.
  424. XIf it does, then the word up to a / is checked to see if it matches
  425. Xthe name of a named directory.  If so, then the ~ and the matched portion
  426. Xare replaced with the value of the named directory.
  427. XA ~ by itself or followed by a / is replaced by the value of the
  428. X\fBHOME\fP parameter.
  429. XA ~ followed by a + or a \- is replaced by the value of 
  430. X\fBPWD\fP or \fBOLDPWD\fP, respectively.
  431. X.PP
  432. XNamed directories are typically login directories for users on the system.
  433. XThey may also be defined if the text after the ~ is the name
  434. Xof a shell parameter whose value begins with a /.
  435. XIn certain circumstances (in prompts, for instance), when the shell
  436. Xprints a path, the path is checked to see if it has a named
  437. Xdirectory as its prefix.  If so, then the prefix portion
  438. Xis replaced with a ~ followed by the name of the directory.
  439. XThe longest match is preferred.
  440. X.PP
  441. XIf a word begins with an unquoted \fB=\fP and the
  442. X\fBNO_EQUALS\fP option is not set,
  443. Xthe remainder of the word is taken as the
  444. Xname of a command or alias.  If a command
  445. Xexists by that name, the word is replaced
  446. Xby the full pathname of the command.
  447. XIf an alias exists by that name, the word
  448. Xis replaced with the text of the alias.
  449. XOtherwise the word is checked up to a /
  450. Xto see if it is a number or a \-.  If so,
  451. Xthe matched portion is replaced with
  452. Xthe \fIn\fPth directory in the directory stack,
  453. Xwhere \fIn\fP is the number matched, or
  454. Xthe last directory in the directory stack
  455. Xif a \- is matched.
  456. X.SS Process Substitution
  457. XEach command argument of the form
  458. X\fB<(\fIlist\^\fB)\fR
  459. Xor
  460. X\fB>(\fIlist\^\fB)\fR
  461. Xor
  462. X\fB=(\fIlist\^\fB)\fR
  463. Xis subject to process substitution.
  464. XIn the case of the
  465. X.B <
  466. Xor
  467. X.B >
  468. Xforms, the shell will run process
  469. X.I list
  470. Xasynchronously connected to a named pipe (FIFO).
  471. XThe name of this pipe will become the argument to the command.
  472. XIf the form with
  473. X.B >
  474. Xis selected then writing on this file will provide input for
  475. X.IR list .
  476. XIf
  477. X.B <
  478. Xis used,
  479. Xthen the file passed as an argument will
  480. Xbe a named pipe connected to the output of the
  481. X.I list
  482. Xprocess.
  483. XFor example,
  484. X.RS
  485. X.PP
  486. X\fBpaste <(cut \-f1\fP \fIfile1\fB) <(cut \-f3\fP \fIfile2\fB) | tee >(\fIprocess1\fB) >(\fIprocess2\fB)\fR >/dev/null
  487. X.RE
  488. X.PP
  489. X.BR cut s
  490. Xfields 1 and 3 from
  491. Xthe files
  492. X.I file1
  493. Xand
  494. X.I file2
  495. Xrespectively,
  496. X.BR paste s
  497. Xthe results together, and sends it to the processes
  498. X.I process1
  499. Xand
  500. X.IR process2 .
  501. XNote that the file, which is passed as an argument to the command,
  502. Xis a system
  503. Xpipe 
  504. Xso programs that expect to
  505. X.BR lseek (2)
  506. Xon the file will not work.
  507. XAlso note that the previous example can be more compactly and
  508. Xefficiently written as:
  509. X.RS
  510. X.PP
  511. X\fBpaste <(cut \-f1\fP \fIfile1\fB) <(cut \-f3\fP \fIfile2\fB) > >(\fIprocess1\fB) > >(\fIprocess2\fB)\fR
  512. X.RE
  513. X.PP
  514. Xthe shell uses pipes instead of a FIFOs to implement the latter
  515. Xtwo process substitutions in the above example.
  516. X.PP
  517. XIf
  518. X.B =
  519. Xis used,
  520. Xthen the file passed as an argument will be the name
  521. Xof a temporary file containing
  522. Xthe output of the
  523. X.I list
  524. Xprocess.  This may be used instead of the
  525. X.B <
  526. Xform for a program that expects to \fBlseek\fP(2) on the input file.
  527. X.SS Parameter Expansion
  528. XThe character \fB$\fP is used to introduce parameter expansions.
  529. XSee \fBPARAMETERS\fP below for a description of parameters.
  530. X.PD
  531. X.RS
  532. X.TP
  533. X\fB${\fIname\fB}\fR
  534. XThe value, if any, of the parameter \fIname\fP is substituted.
  535. XThe braces are required with \fIname\fP is followed by
  536. Xa letter, digit, or underscore that is not to be interpreted
  537. Xas part of its name.
  538. XIf \fIname\fP is an array parameter, then the values of each
  539. Xelement of \fIname\fP is substituted, one element per word.
  540. XOtherwise, the expansion results in one word only; no
  541. Xword splitting is done on the result.
  542. X.TP
  543. X\fB${\fIname\fB:\-\fIword\fB}\fR
  544. XIf \fIname\fP is set and is non-null then substitute its
  545. Xvalue; otherwise substitute \fIword\fP.
  546. X.TP
  547. X\fB${\fIname\fB:=\fIword\fB}\fR
  548. XIf \fIname\fP is unset and is null then
  549. Xset it to \fIword\fP; the value of the parameter is then
  550. Xsubstituted.
  551. X.TP
  552. X\fB${\fIname\fB:?\fIword\fB}\fR
  553. XIf \fIname\fP is set and is non-null, then substitute
  554. Xits value; otherwise, print \fIword\fP and exit from the shell.
  555. XIf \fIword\fP is omitted, then a standard message is printed.
  556. X.TP
  557. X\fB${\fIname\fB:+\fIword\fB}\fR
  558. XIf \fIname\fP is set and is non-null then substitute
  559. X\fIword\fP; otherwise substitute nothing.
  560. X.PD 0
  561. X.TP
  562. X\fB${\fIname\fB#\fIpattern\fB}\fR
  563. X.TP
  564. X\fB${\fIname\fB##\fIpattern\fB}\fR
  565. X.PD
  566. XIf the \fIpattern\fP matches the beginning of the value of
  567. X\fIname\fP, then substitute the value of \fIname\fP with
  568. Xthe matched portion deleted; otherwise, just
  569. Xsubstitute the value of \fIname\fP.  In the first
  570. Xform, the smallest matching pattern is preferred;
  571. Xin the second form, the largest matching pattern is preferred.
  572. X.PD 0
  573. X.TP
  574. X${\fIname\fB%\fIpattern\fR}
  575. X.TP
  576. X${\fIname\fB%%\fIpattern\fR}
  577. X.PD
  578. XIf the \fIpattern\fP matches the end of the value of
  579. X\fIname\fP, then substitute the value of \fIname\fP with
  580. Xthe matched portion deleted; otherwise, just
  581. Xsubstitute the value of \fIname\fP.  In the first
  582. Xform, the smallest matching pattern is preferred;
  583. Xin the second form, the largest matching pattern is preferred.
  584. X.TP
  585. X${\fB#\fIspec\fR}
  586. XIf \fIspec\fP is one of the above substitutions, substitute
  587. Xthe length in characters of the result instead of
  588. Xthe result itself.  If \fIspec\fP is an array expression,
  589. Xsubstitute the number of elements of the result.
  590. X.TP
  591. X${\fB^\fIspec\fR}
  592. XToggle the value of the \fBRC_EXPAND_PARAM\fP option for the
  593. Xevaluation of \fIspec\fP.
  594. XWhen this option is set, array expansions of the form
  595. X\fIfoo\fB${\fIxx\fB}\fIbar\fR, where the parameter
  596. X\fIxx\fP is set to (\fIa b c\fP), are substituted with
  597. X\fIfooabar foobbar foocbar\fP instead of the default
  598. X\fIfooa b cbar\fP.
  599. X.TP
  600. X${\fB=\fIspec\fR}
  601. XToggle the value of the \fBSH_WORD_SPLIT\fP option for the
  602. Xevaluation of \fIspec\fP.
  603. XWhen this option is set, parameter values are split into
  604. Xseparate words using \fBIFS\fP as a delimiter
  605. Xbefore substitution.
  606. XThis is done by default in most other shells.
  607. X.PD
  608. X.RE
  609. X.PP
  610. XIf the colon is omitted from one of the above expressions
  611. Xcontaining a colon, then the shell only checks whether
  612. X\fIname\fP is set or not, not whether it is null.
  613. X.SS Command Substitution
  614. XA command enclosed in parentheses
  615. Xpreceded by a dollar sign, like so: $(...) or quoted with grave
  616. Xaccents: `...` is replaced with its standard output.
  617. XIf the substitution is not enclosed in double quotes, the
  618. Xoutput is broken into words using the \fBIFS\fP parameter.
  619. XThe substitution \fB$(cat foo)\fP may be replaced
  620. Xby the equivalent but faster \fB$(<foo)\fP.
  621. X.SS Arithmetic Expansion
  622. XA string of the form \fB$[\fIexp\fB]\fR is substituted
  623. Xwith the value of the arithmetic expression \fIexp\fP.
  624. X\fIexp\fP is treated as if it were within single quotes.
  625. XSee \fBARITHMETIC EVALUATION\fP below.
  626. X.SS Brace Expansion
  627. XA string of the form
  628. X\fIfoo\fB{\fIxx\fB,\fIyy\fB,\fIzz\fB}\fIbar\fR
  629. Xis expanded to the individual words
  630. X\fIfooxxbar\fP, \fIfooyybar\fP, and \fIfoozzbar\fP.
  631. XLeft-to-right order is preserved.  This construct
  632. Xmay be nested.  Malformed brace expansion expressions,
  633. Xincluding expressions without a comma, are left unchanged
  634. Xby the shell.
  635. X.PP
  636. XAn expression of the form
  637. X\fB{\fIx\fB\-\fIy\fB}\fR,
  638. Xwhere \fIx\fP and \fIy\fP are single characters,
  639. Xis expanded to every character between
  640. X\fIx\fP and \fIy\fP, inclusive.
  641. X.SS Filename Generation
  642. XIf a word contains an unquoted instance of one of the characters
  643. X*, |, <, [, or ?, it is regarded
  644. Xas a pattern for filename generation, unless the \fBNOGLOB\fP option is set.
  645. XIf the \fBEXTENDED_GLOB\fP option is set, the
  646. X^ and # characters also denote a pattern; otherwise
  647. Xthey are not treated specially by the shell.
  648. XThe word is replaced with a list of sorted filenames that match
  649. Xthe pattern.  If no matching pattern is found, the shell gives
  650. Xan error message, unless the \fBNULLGLOB\fP option is set,
  651. Xin which case the word is deleted; or unless the \fBNO_NOMATCH\fP
  652. Xoption is set, in which case the word is left unchanged.
  653. XIn filename generation,
  654. Xthe character / must be matched explicitly; also, a . must be matched
  655. Xexplicitly at the beginning of a pattern or after a /, unless the
  656. X\fBGLOBDOTS\fP option is set.  No filename generation pattern
  657. Xmatches the files "." or "..".  In other instances of pattern
  658. Xmatching, the / and . are not treated specially.
  659. X.PP
  660. X.RS
  661. X.PD 0
  662. X.TP
  663. X.B *
  664. Xmatches any string, including the null string.
  665. X.TP
  666. X.B ?
  667. Xmatches any character.
  668. X.TP
  669. X\fB[ ... ]\fP
  670. Xmatches any of the enclosed characters.
  671. X.TP
  672. X\fB[^ ... ]\fP
  673. Xmatches any character except the enclosed characters.
  674. X.TP
  675. X\fB<x\-y>\fP
  676. Xmatches any number in the range x to y, inclusive.
  677. XIf x is omitted, the number must be less than or equal to y.
  678. XIf y is omitted, the number must be greater than or equal to x.
  679. XA pattern of the form \fB<\->\fP or
  680. Xsimply \fB<>\fP matches any number.
  681. X.TP
  682. X\fB^x\fP
  683. Xmatches anything except the pattern x.
  684. X.TP
  685. X\fBx|y\fP
  686. Xmatches either x or y.
  687. X.TP
  688. X\fBx#\fP
  689. Xmatches zero or more occurrences of the pattern x.
  690. X.TP
  691. X\fBx##\fP
  692. Xmatches one or more occurrences of the pattern x.
  693. X.RE
  694. X.PD
  695. X.PP
  696. XParentheses may be used for grouping.  Note that the \fB|\fP character
  697. Xmust be within parentheses, so that the lexical analyzer does
  698. Xnot think it is a pipe character.  Also note that "/" has a
  699. Xhigher precedence than "^"; that is:
  700. X.RS
  701. X.PP
  702. Xls
  703. X.BI ^ foo / bar
  704. X.RE
  705. X.PP
  706. Xwill search directories in "." except "./foo" for a file named bar.
  707. X.PP
  708. XA pathname component of the form
  709. X.BI ( foo /)#
  710. Xmatches a path consisting of zero or more directories
  711. Xmatching the pattern foo.
  712. XAs a shorthand,
  713. X.B **/
  714. Xis equivalent to
  715. X.BR (*/)# .
  716. XThus:
  717. X.RS
  718. X.PP
  719. Xls
  720. X.BI (*/)# bar
  721. X.RE
  722. X.PP
  723. Xor
  724. X.RS
  725. X.PP
  726. Xls
  727. X.BI **/ bar
  728. X.RE
  729. X.PP
  730. Xdoes a recursive directory search for files named bar.
  731. X.PP
  732. XIf used for filename generation, a pattern may contain an exclusion
  733. Xspecifier.  Such patterns are of the form \fIpat1\fB~\fIpat2\fR.
  734. XThis pattern will generate all files matching \fIpat1\fP, but which
  735. Xdo not match \fIpat2\fP.  For example, \fB*.c~lex.c\fP will match
  736. Xall files ending in .c, except the file \fBlex.c\fP.
  737. X.PP
  738. XPatterns used for filename generation may also end in a
  739. Xlist of qualifiers enclosed in parentheses.
  740. XThe qualifiers
  741. Xspecify which filenames that otherwise match the given pattern
  742. Xwill be inserted in the argument list.
  743. XA qualifier may be any one of the following:
  744. X.PD 0
  745. X.RS
  746. X.TP
  747. X.B /
  748. Xdirectories
  749. X.TP
  750. X.B .
  751. Xplain files
  752. X.TP
  753. X.B @
  754. Xsymbolic links
  755. X.TP
  756. X.B =
  757. Xsockets
  758. X.TP
  759. X.B p
  760. Xnamed pipes (FIFOs)
  761. X.TP
  762. X.B *
  763. Xexecutable plain files (0100)
  764. X.TP
  765. X.B %
  766. Xdevice files (character or block special)
  767. X.TP
  768. X.B r
  769. Xreadable files (0400)
  770. X.TP
  771. X.B w
  772. Xwritable files (0200)
  773. X.TP
  774. X.B x
  775. Xexecutable files (0100)
  776. X.TP
  777. X.B R
  778. Xworld-readable files (0004)
  779. X.TP
  780. X.B W
  781. Xworld-writable files (0002)
  782. X.TP
  783. X.B X
  784. Xworld-executable files (0001)
  785. X.TP
  786. X.B s
  787. Xsetuid files (04000)
  788. X.TP
  789. X.B S
  790. Xsetgid files (02000)
  791. X.TP
  792. X\fBd\fIdev\fR
  793. Xfiles on the device \fIdev\fP
  794. X.TP
  795. X\fBl\fIct\fR
  796. Xfiles having a link count of \fIct\fP
  797. X.TP
  798. X\fBU\fP
  799. Xfiles owned by the effective user id
  800. X.TP
  801. X\fBG\fP
  802. Xfiles owned by the effective group id
  803. X.TP
  804. X\fBu\fInum\fR
  805. Xfiles owned by user id \fInum\fP
  806. X.TP
  807. X\fBg\fInum\fR
  808. Xfiles owned by group id \fInum\fP
  809. X.TP
  810. X\fB^\fP
  811. Xnegates all qualifiers following it
  812. X.TP
  813. X\fBM\fP
  814. Xsets the \fBMARKDIRS\fP option for the current pattern
  815. X.TP
  816. X\fBN\fP
  817. Xsets the \fBNULLGLOB\fP option for the current pattern
  818. X.TP
  819. X\fBD\fP
  820. Xsets the \fBGLOBDOTS\fP option for the current pattern
  821. X.PD
  822. X.RE
  823. X.PP
  824. XThus:
  825. X.RS
  826. X.PP
  827. Xls
  828. X.B
  829. X*(%W)
  830. X.RE
  831. X.PP
  832. Xlists all world-writable device files in the current directory,
  833. Xand
  834. X.RS
  835. X.PP
  836. Xls
  837. X.B /tmp/foo*(u0^@)
  838. X.RE
  839. X.PP
  840. Xlists all root-owned files beginning with the string
  841. X"foo" in /tmp, ignoring symlinks, and
  842. X.RS
  843. X.PP
  844. Xls
  845. X.B *.*~(lex|parse).[ch](^D^l1)
  846. X.RE
  847. X.PP
  848. Xlists all files having a link count of one whose names contain a dot
  849. X(but not those starting with a dot, since \fBGLOBDOTS\fP is explicitly
  850. Xswitched off) except for lex.c, lex.h, parse.c, and parse.h.
  851. XA "/" at the end of a pattern
  852. Xis equivalent to "(\|/\|)".
  853. X.SH REDIRECTION
  854. XBefore a command is executed, its input and output
  855. Xmay be redirected.
  856. XThe following may appear anywhere in a simple-command
  857. Xor may precede or follow a complex command.
  858. XSubstitution occurs before
  859. X.I word
  860. Xis used except as noted below.
  861. XIf the result of substitution on
  862. X.I word
  863. Xproduces more than one filename,
  864. Xredirection occurs for each
  865. Xseparate filename in turn.
  866. X.TP
  867. X.BI < word
  868. XOpen file
  869. X.I word
  870. Xas standard input.
  871. X.TP
  872. X.BI > word
  873. XOpen file
  874. X.I word
  875. Xas standard output.
  876. XIf the file does not exist then it is created.
  877. XIf the file exists, and the
  878. X.B NOCLOBBER
  879. Xoption is set,
  880. Xthis causes an error;
  881. Xotherwise, it is truncated to zero length.
  882. X.TP
  883. X.BI >! " word"
  884. XSame as
  885. X.BR > ,
  886. Xexcept that the file is truncated to zero length
  887. Xif it exists, even if
  888. X.B NOCLOBBER
  889. Xis set.
  890. X.TP
  891. X.BI >> word
  892. XOpen file
  893. X.I word
  894. Xas standard output.
  895. XIf the file exists then output is appended to it.
  896. XIf the file does not exist, and the
  897. X.B NOCLOBBER
  898. Xoption is set,
  899. Xthis causes an error;
  900. Xotherwise, the file is created.
  901. X.TP
  902. X.BI >>! " word"
  903. XSame as
  904. X.BR >> ,
  905. Xexcept that the file is created if it does not
  906. Xexist, even if
  907. X.B NOCLOBBER
  908. Xis set.
  909. X.TP
  910. X\fB<<\fP[\-] \fIword\fP
  911. XThe shell input is read up to a line that is the same as
  912. X.IR word ,
  913. Xor to an end-of-file.
  914. XNo parameter substitution, command substitution or
  915. Xfilename generation is performed on
  916. X.IR word .
  917. XThe resulting document,
  918. Xcalled a
  919. X.IR here-document ,
  920. Xbecomes
  921. Xthe standard input.
  922. XIf any character of \fIword\fP is quoted with
  923. Xsingle or double quotes (a \e alone is \fInot\fP sufficient),
  924. Xno interpretation
  925. Xis placed upon the characters of the document.
  926. XOtherwise, parameter and command substitution
  927. Xoccurs, \e followed by a newline is removed,
  928. Xand \e must be used to quote the characters
  929. X\e, $, `, and the first character of \fIword\fP.
  930. XIf <<\- is used, then all leading
  931. Xtabs are stripped from \fIword\fP and from the document.
  932. X.TP
  933. X.BI <<< word
  934. XOpen a file containing \fIword\fP, after expansion,
  935. Xas standard input.
  936. X.TP
  937. X.BI <& digit
  938. XThe standard input
  939. Xis duplicated from file descriptor
  940. X.I digit
  941. X(see
  942. X.IR dup (2)).
  943. XSimilarly for standard output using
  944. X\fB>&\fIdigit\fP.
  945. X.TP
  946. X.BI >& word
  947. XSame as
  948. X.BI > word
  949. X\fB2>&\fP1.
  950. X.TP
  951. X.BI >>& word
  952. XSame as
  953. X.BI >> word
  954. X\fB2>&\fP1.
  955. X.TP
  956. X.BI <&\-
  957. XClose the standard input.
  958. X.TP
  959. X.BI >&\-
  960. XClose the standard output.
  961. X.TP
  962. X.BI <&p
  963. XThe input from the coprocess is moved to the standard input.
  964. X.TP
  965. X.BI >&p
  966. XThe output to the coprocess is moved to the standard output.
  967. X.PP
  968. XIf one of the above is preceded by a digit, then the file
  969. Xdescriptor referred to is that specified by the digit
  970. X(instead of the default 0 or 1).
  971. XThe order in which redirections are specified is significant.
  972. Xthe shell evaluates each redirection in terms of the
  973. X.RI ( "file descriptor" ", " file )
  974. Xassociation at the time of evaluation.
  975. XFor example:
  976. X.RS
  977. X.PP
  978. X\&.\|.\|. \|1>\fIfname\^\fP 2>&1
  979. X.RE
  980. X.PP
  981. Xfirst associates file descriptor 1 with file
  982. X.IR fname .
  983. XIt then associates file descriptor 2 with the file associated with file
  984. Xdescriptor 1 (that is,
  985. X.IR fname ).
  986. XIf the order of redirections were reversed, file descriptor 2 would be associated
  987. Xwith the terminal (assuming file descriptor 1 had been) and then file descriptor
  988. X1 would be associated with file
  989. X.IR fname .
  990. X.PP
  991. XIf the user tries to open a file descriptor for writing more than once,
  992. Xthe shell opens the file descriptor as a pipe to a process that copies
  993. Xits input to all the specified outputs, similar to tee(1).  Thus:
  994. X.RS
  995. X.PP
  996. X.B date >foo >bar
  997. X.RE
  998. X.PP
  999. Xwrites the date to two files, named "foo" and "bar".
  1000. XNote that a pipe is an implicit indirection; thus
  1001. X.RS
  1002. X.PP
  1003. X.B date >foo | cat
  1004. X.RE
  1005. X.PP
  1006. Xwrites the date to the file "foo", and also pipes it to cat.
  1007. X.PP
  1008. XIf the user tries to open a file descriptor for reading more than once,
  1009. Xthe shell opens the file descriptor as a pipe to a process that copies
  1010. Xall the specified inputs to its output in the order
  1011. Xspecified, similar to cat(1).  Thus
  1012. X.RS
  1013. X.PP
  1014. X.B sort <foo <fubar
  1015. X.RE
  1016. X.PP
  1017. Xor even
  1018. X.RS
  1019. X.PP
  1020. X.B sort <f{oo,ubar}
  1021. X.RE
  1022. X.PP
  1023. Xis equivalent to "cat foo bar | sort".  Note that
  1024. Xa pipe is in implicit indirection; thus
  1025. X.RS
  1026. X.PP
  1027. X.B cat bar | sort <foo
  1028. X.RE
  1029. X.PP
  1030. Xis equivalent to "cat bar foo | sort" (note the order of the inputs).
  1031. X.PP
  1032. XIf a simple command consists of one or more redirection operators
  1033. Xand zero or more parameter assignments, but no command name,
  1034. Xthe command \fBcat\fP is assumed.  Thus
  1035. X.RS
  1036. X.PP
  1037. X.B < file
  1038. X.RE
  1039. X.PP
  1040. Xprints the contents of \fBfile\fP.
  1041. X.PP
  1042. XIf a command is followed by
  1043. X.B &
  1044. Xand job control is not active,
  1045. Xthen the default standard input
  1046. Xfor the command
  1047. Xis the empty file
  1048. X.BR /dev/null .
  1049. XOtherwise, the environment for the execution of a command contains the
  1050. Xfile descriptors of the invoking shell as modified by
  1051. Xinput/output specifications.
  1052. X.SH "COMMAND EXECUTION"
  1053. XIf a command name contains no slashes, the shell attempts to locate
  1054. Xit.  If there exists a shell function by that name, the function
  1055. Xis invoked as described below in \fBFUNCTIONS\fP.  If there exists
  1056. Xa shell builtin by that name, the builtin is invoked.
  1057. X.PP
  1058. XOtherwise, the shell searches each element of \fBpath\fP for a
  1059. Xdirectory containing an executable file by that name.  If the
  1060. Xsearch is unsuccessful, the shell prints an error message and returns
  1061. Xa nonzero exit status.
  1062. X.PP
  1063. XIf execution fails because the file is not in executable format,
  1064. Xand the file is not a directory, it is assumed to be a shell
  1065. Xscript.  /bin/sh is spawned to execute it.  If the program
  1066. Xis a file beginning with \fB#!\fP, the remainder of the first line
  1067. Xspecifies an interpreter for the program.  The shell will
  1068. Xexecute the specified interpreter on operating systems that do
  1069. Xnot handle this executable format in the kernel.
  1070. X.SH FUNCTIONS
  1071. X.PP
  1072. XThe
  1073. X.B function
  1074. Xreserved word is used to define shell functions.
  1075. XShell functions are read in and stored internally.
  1076. XAlias names are resolved when the function is read.
  1077. XFunctions are executed like commands with the arguments
  1078. Xpassed as positional parameters.
  1079. X(See
  1080. X.I Execution
  1081. Xbelow).
  1082. X.PP
  1083. XFunctions execute in the same process as the caller and
  1084. Xshare all files
  1085. Xand present working directory with the
  1086. Xcaller.
  1087. XA trap on
  1088. X.B EXIT
  1089. Xset inside a function
  1090. Xis executed after the function completes in the environment
  1091. Xof the caller.
  1092. X.PP
  1093. XThe
  1094. X.B return
  1095. Xbuiltin is used to return
  1096. Xfrom function calls.
  1097. X.PP
  1098. XFunction identifiers
  1099. Xcan be listed with the
  1100. X.B functions
  1101. Xbuiltin.
  1102. XFunctions can be undefined with the
  1103. X.B unfunction
  1104. Xbuiltin.
  1105. X.PP
  1106. XThe following functions, if defined, have special meaning to
  1107. Xthe shell:
  1108. X.PP
  1109. X.PD 0
  1110. X.TP
  1111. X\fBchpwd\fP
  1112. XExecuted whenever the current working directory is changed.
  1113. X.TP
  1114. X\fBprecmd\fP
  1115. XExecuted before each prompt.
  1116. X.TP
  1117. X\fBperiodic\fP
  1118. XIf the parameter
  1119. X.B PERIOD
  1120. Xis set, this function is executed every
  1121. X.B PERIOD
  1122. Xseconds, just before a prompt.
  1123. X.TP
  1124. X\fBTRAPxxx\fP
  1125. XIf defined and non-null,
  1126. Xthis function will be executed whenever the shell
  1127. Xcatches a signal \fBSIGxxx\fP, where \fBxxx\fP is a signal
  1128. Xname as specified for the \fBkill\fP builtin (see below).
  1129. XIn addition, \fBTRAPERR\fP is executed whenever a command has a non-zero
  1130. Xexit status, \fBTRAPDEBUG\fP is executed after each command, and
  1131. X\fBTRAPEXIT\fP
  1132. Xis executed when the shell exits,
  1133. Xor when the current function exits if defined
  1134. Xinside a function.
  1135. XIf a function of this form is defined and null,
  1136. Xthe shell and processes spawned by it will ignore \fBSIGxxx\fP.
  1137. X.PD
  1138. X.SH JOBS
  1139. X.PP
  1140. XIf the
  1141. X.B MONITOR
  1142. Xoption is set,
  1143. Xan interactive shell associates a \fIjob\fR with each pipeline.
  1144. XIt keeps
  1145. Xa table of current jobs, printed by the
  1146. X.B jobs
  1147. Xcommand, and assigns them small integer numbers.
  1148. XWhen a job is started asynchronously with
  1149. X.BR & ,
  1150. Xthe shell prints a line which looks
  1151. Xlike:
  1152. X.PP
  1153. X.DT
  1154. X    [1] 1234
  1155. X.PP
  1156. Xindicating that the job which was started asynchronously was job number
  1157. X1 and had one (top-level) process, whose process id was 1234.
  1158. X.PP
  1159. XIf you are running a job and wish to do something else you may hit the key
  1160. X\fB^Z\fR (control-Z) which sends a STOP signal to the current job.
  1161. Xthe shell will then normally indicate that the job has been `suspended',
  1162. Xand print another prompt.
  1163. XYou can then manipulate the state of this job,
  1164. Xputting it in the background with the
  1165. X.B bg
  1166. Xcommand, or run some other
  1167. Xcommands and then eventually bring the job back into the foreground with
  1168. Xthe foreground command
  1169. X.BR fg .
  1170. XA \fB^Z\fR takes effect immediately and
  1171. Xis like an interrupt in that pending output and unread input are discarded
  1172. Xwhen it is typed.
  1173. X.PP
  1174. XA job being run in the background will suspend if it tries to read
  1175. Xfrom the terminal.
  1176. XBackground jobs are normally allowed to produce output,
  1177. Xbut this can be disabled by giving the command ``stty tostop''.
  1178. XIf you set this
  1179. Xtty option, then background jobs will suspend when they try to produce
  1180. Xoutput like they do when they try to read input.
  1181. X.PP
  1182. XThere are several ways to refer to jobs in the shell.
  1183. XA job can be referred to by the process id of any process of the job
  1184. Xor by one of the following:
  1185. X.PD 0
  1186. X.TP
  1187. X.BI % number
  1188. XThe job with the given number.
  1189. X.TP
  1190. X.BI % string
  1191. XAny job whose command line begins with
  1192. X.IR string .
  1193. X.TP
  1194. X.BI %? string
  1195. XAny job whose command line contains
  1196. X.IR string .
  1197. X.TP
  1198. X.BI %%
  1199. XCurrent job.
  1200. X.TP
  1201. X.BI %+
  1202. XEquivalent to
  1203. X.BR %% .
  1204. X.TP
  1205. X.BI %\-
  1206. XPrevious job.
  1207. X.PD
  1208. X.PP
  1209. XThe shell learns immediately whenever a process changes state.
  1210. XIt normally informs you whenever a job becomes blocked so that
  1211. Xno further progress is possible.  If
  1212. X.B notify
  1213. Xis not set, it waits until
  1214. Xjust before it prints
  1215. Xa prompt before it informs you.
  1216. X.PP
  1217. XWhen the monitor mode is on, each background job that completes
  1218. Xtriggers any trap set for
  1219. X.BR CHLD .
  1220. X.PP
  1221. XWhen you try to leave the shell while jobs are running or suspended, you will
  1222. Xbe warned that `You have suspended (running) jobs.'
  1223. XYou may use the
  1224. X.B jobs
  1225. Xcommand to see what they are.
  1226. XIf you do this or immediately try to
  1227. Xexit again, the shell will not warn you a second time; the suspended
  1228. Xjobs will be terminated, and the running jobs will be sent
  1229. Xa \fBSIGHUP\fP signal.
  1230. XTo avoid having the shell terminate the running jobs, either
  1231. Xuse the \fBnohup\fP(1) command or the \fBdisown\fP builtin (see below).
  1232. X.SH SIGNALS
  1233. XThe INT and QUIT signals for an invoked
  1234. Xcommand are ignored if the command is followed by
  1235. X.B &
  1236. Xand job
  1237. X.B monitor
  1238. Xoption is not active.
  1239. XOtherwise, signals have the values
  1240. Xinherited by the shell from its parent
  1241. X(but see the \fBTRAPxxx\fP special function above).
  1242. X.SH HISTORY
  1243. XHistory substitution allows you to use words from previous command
  1244. Xlines in the command line you are typing.  This simplifies spelling
  1245. Xcorrections and the repetition of complicated commands or arguments.
  1246. XCommand lines are saved in the history list, the size of which
  1247. Xis controlled by the
  1248. X.B HISTSIZE
  1249. Xvariable.  The most recent command is retained in any case.
  1250. XA history substitution begins with a
  1251. X.B !
  1252. Xand may occur anywhere on the command line; history
  1253. Xsubstitutions do not nest.  The
  1254. X.B !
  1255. Xcan be escaped with
  1256. X.B \e
  1257. Xto suppress its special meaning.
  1258. XSingle or double quotes will \fInot\fP work for this.
  1259. X.PP
  1260. XInput lines containing history substitutions are echoed on the
  1261. Xterminal after being expanded, but before any other
  1262. Xsubstitutions take place or the command gets executed.
  1263. X.SS Event Designators
  1264. X.PP
  1265. XAn event designator is a reference to a command-line entry in
  1266. Xthe history list.
  1267. X.RS
  1268. X.PD 0
  1269. X.TP
  1270. X.B !
  1271. XStart a history substitution, except when followed by a blank, newline,
  1272. X.BR = ,
  1273. Xor
  1274. X.BR ( .
  1275. X.TP
  1276. X.B !!
  1277. XRefer to the previous command. 
  1278. XBy itself, this substitution
  1279. Xrepeats the previous command.
  1280. X.TP
  1281. X.BI ! n
  1282. XRefer to command-line
  1283. X.IR n .
  1284. X.TP
  1285. X.BI ! \-n
  1286. XRefer to the current command-line minus
  1287. X.IR n .
  1288. X.TP
  1289. X.BI  ! str
  1290. XRefer to the most recent command starting with
  1291. X.IR str .
  1292. X.TP
  1293. X.BI  !? str\fR[\fP ? \fR]\fP
  1294. XRefer to the most recent command containing
  1295. X.IR str .
  1296. X.TP
  1297. X.B !#
  1298. XRefer to the current command line typed in so far.
  1299. X.TP
  1300. X.BR !{ .\|.\|. }
  1301. XInsulate a history reference from adjacent characters (if necessary).
  1302. X.PD
  1303. X.RE
  1304. X.SS Word Designators
  1305. X.PP
  1306. XA
  1307. X.RB ` : '
  1308. Xseparates the event specification from the word designator. 
  1309. XIt can be omitted if the word designator begins with a
  1310. X.BR \*^ ,
  1311. X.BR $ ,
  1312. X.BR * ,
  1313. X.B \-
  1314. Xor
  1315. X.BR % .
  1316. XIf the word is to be selected from the previous command, the second
  1317. X.B !
  1318. Xcharacter can be omitted from the event specification.  For instance,
  1319. X.B !!:1
  1320. Xand
  1321. X.B !:1
  1322. Xboth refer to the first word of the previous command, while
  1323. X.B !!$
  1324. Xand
  1325. X.B !$
  1326. Xboth refer to the last word in the previous command. 
  1327. XWord designators include:
  1328. X.RS
  1329. X.PD 0
  1330. X.TP
  1331. X.B 0
  1332. XThe first input word (command).
  1333. X.TP
  1334. X.I n
  1335. XThe
  1336. X.IR n 'th
  1337. Xargument.
  1338. X.TP
  1339. X.B ^
  1340. XThe first argument, that is,
  1341. X.BR 1 .
  1342. X.TP
  1343. X.B $
  1344. XThe last argument.
  1345. X.TP
  1346. X.B %
  1347. XThe word matched by (the most recent)
  1348. X.BI ? s
  1349. Xsearch.
  1350. X.TP
  1351. X.IB x \- y
  1352. XA range of words;
  1353. X.BI \- y
  1354. Xabbreviates
  1355. X.BI 0\- y\fR.
  1356. X.TP
  1357. X.B *
  1358. XAll the arguments, or a null value if there is just
  1359. Xone word in the event.
  1360. X.TP
  1361. X.IB x *
  1362. XAbbreviates
  1363. X.IB x \-$ .
  1364. X.TP
  1365. X.IB x \-
  1366. XLike
  1367. X.I x*
  1368. Xbut omitting word
  1369. X.BR $ .
  1370. X.PD
  1371. X.RE
  1372. X.SS Modifiers
  1373. X.PP
  1374. XAfter the optional word designator, you can add
  1375. Xa sequence of one or more of the following modifiers,
  1376. Xeach preceded by a
  1377. X.BR : .
  1378. XThese modifiers also work on the result
  1379. Xof filename and parameter expansion.
  1380. X.RS
  1381. X.TP
  1382. X.B h
  1383. XRemove a trailing pathname component, leaving the head.
  1384. X.PD 0
  1385. X.TP
  1386. X.B r
  1387. XRemove a trailing suffix of the form
  1388. X.RB ` "\&.\fIxxx" ',
  1389. Xleaving the basename.
  1390. X.TP
  1391. X.B e
  1392. XRemove all but the suffix.
  1393. X.TP
  1394. X.B t
  1395. XRemove all leading pathname components, leaving the tail.
  1396. X.TP
  1397. X.B &
  1398. XRepeat the previous substitution.
  1399. X.TP
  1400. X.B g
  1401. XApply the change to the first occurrence of a match in each word,
  1402. Xby prefixing the above (for example,
  1403. X.BR g& ).
  1404. X.TP
  1405. X.B p
  1406. XPrint the new command but do not execute it.
  1407. X.TP
  1408. X.B q
  1409. XQuote the substituted words, escaping further substitutions.
  1410. X.TP
  1411. X.B x
  1412. XLike
  1413. X.BR q ,
  1414. Xbut break into words at each blank.
  1415. X.TP
  1416. X.B l
  1417. XConvert the words to all lowercase.
  1418. X.TP
  1419. X.B u
  1420. XConvert the words to all uppercase.
  1421. X.TP
  1422. X.BI s/ l / r\fR[\fP / \fR]\fP
  1423. XSubstitute
  1424. X.I r
  1425. Xfor
  1426. X.IR l .
  1427. X.PD
  1428. X.RE
  1429. X.PP
  1430. XUnless preceded by a
  1431. X.BR g ,
  1432. Xthe substitution is done only for the
  1433. Xfirst string that matches
  1434. X.IR l .
  1435. X.PP
  1436. XThe left-hand side of substitutions are not regular expressions,
  1437. Xbut character strings.
  1438. XAny character can be used as the delimiter in place of
  1439. X.BR / .
  1440. XA backslash quotes the delimiter character.
  1441. XThe character
  1442. X.BR & ,
  1443. Xin the right hand side, is replaced by the text
  1444. Xfrom the left-hand-side. 
  1445. XThe
  1446. X.B &
  1447. Xcan be quoted with a backslash. 
  1448. XA null
  1449. X.I l
  1450. Xuses the previous string either from a
  1451. X.I l
  1452. Xor from a contextual scan string
  1453. X.I s
  1454. Xfrom
  1455. X.BI !? s\fR.
  1456. XYou can omit the rightmost delimiter if a newline
  1457. Ximmediately follows
  1458. X.IR r ;
  1459. Xthe rightmost
  1460. X.B ?
  1461. Xin a context scan can similarly be omitted.
  1462. X.PP
  1463. XWithout an event specification, a history reference refers either to the
  1464. Xprevious command, or to a previous history reference on the command line
  1465. X(if any).
  1466. X.PP
  1467. XThe character sequence
  1468. X.BI ^ foo ^ bar
  1469. Xrepeats the last command, replacing the string "foo" with the
  1470. Xstring "bar".
  1471. X.PP
  1472. XIf the shell encounters the character sequence
  1473. X\fB!"\fP
  1474. Xin the input, the history mechanism is temporarily disabled until
  1475. Xthe current list is fully parsed.  The
  1476. X\fB!"\fP
  1477. Xis removed from the input, and any subsequent
  1478. X.B !
  1479. Xcharacters have no special significance.
  1480. X.PP
  1481. XA less convenient but more comprehensible
  1482. Xform of command history support
  1483. Xis provided by the
  1484. X.B fc
  1485. Xbuiltin (see below).
  1486. X.SH "ARITHMETIC EVALUATION"
  1487. XAn ability to perform integer arithmetic
  1488. Xis provided with the builtin
  1489. X.BR let .
  1490. XEvaluations are performed using
  1491. X.I long
  1492. Xarithmetic.
  1493. XConstants are of the form
  1494. X[\fIbase\fB#\^\fR]\fIn\^\fP
  1495. Xwhere
  1496. X.I base
  1497. Xis a decimal number between two and thirty-six
  1498. Xrepresenting the arithmetic base
  1499. Xand
  1500. X.I n
  1501. Xis a number in that base.
  1502. XIf
  1503. X.I base
  1504. Xis omitted
  1505. Xthen base 10 is used.
  1506. X.PP
  1507. XAn arithmetic expression uses nearly the same syntax, precedence, and
  1508. Xassociativity of
  1509. Xexpressions in C.
  1510. XThe following operators are supported (listed in decreasing order
  1511. Xof precedence):
  1512. X.PP
  1513. X.PD 0
  1514. X.RS
  1515. X.TP
  1516. X.B + \- ! \(ap ++ \-\|\-
  1517. Xunary plus/minus, logical NOT, complement, {pre,post}{in,de}crement
  1518. X.TP
  1519. X.B &
  1520. Xlogical AND
  1521. X.TP
  1522. X.B ^
  1523. Xlogical XOR
  1524. X.TP
  1525. X.B |
  1526. Xlogical OR
  1527. X.TP
  1528. X.B * / %
  1529. Xmultiplication, division, remainder
  1530. X.TP
  1531. X.B + \-
  1532. Xaddition, subtraction
  1533. X.TP
  1534. X.B << >>
  1535. Xlogical shift left, shift right
  1536. X.TP
  1537. X.B < > <= >=
  1538. Xcomparison
  1539. X.TP
  1540. X.B == !=
  1541. Xequality and inequality
  1542. X.TP
  1543. X.B &&
  1544. Xboolean AND
  1545. X.TP
  1546. X.B |\|| ^^
  1547. Xboolean OR, XOR
  1548. X.TP
  1549. X.B ? :
  1550. Xternary operator
  1551. X.TP
  1552. X.B
  1553. X= += \-= *= /= %= &= ^= |= <<= >>= &&= |\||= ^^=
  1554. Xassignment
  1555. X.TP
  1556. X.B ,
  1557. Xcomma operator
  1558. X.PD
  1559. X.RE
  1560. X.PP
  1561. XThe operators &&, |\||, &&=, and |\||= are short-circuiting,
  1562. Xand only one of the latter two expressions in a ternary operator
  1563. Xis evaluated.  Note the precedence of the logical AND, OR,
  1564. Xand XOR operators.
  1565. X.PP
  1566. XNamed parameters can be referenced by name within an arithmetic expression
  1567. Xwithout using the parameter substitution syntax.
  1568. X.PP
  1569. XAn internal integer representation of a named parameter
  1570. Xcan be specified with the
  1571. X.B integer
  1572. Xbuiltin.
  1573. XArithmetic evaluation is performed on the value of each
  1574. Xassignment to a named parameter declared integer
  1575. Xin this manner.
  1576. X.PP
  1577. XSince many of the arithmetic operators require
  1578. Xquoting, an alternative form of the
  1579. X.B let
  1580. Xcommand is provided.
  1581. XFor any command which begins with a
  1582. X.BR (( ,
  1583. Xall the characters until a matching
  1584. X.B ))
  1585. Xare treated as a quoted expression.
  1586. XMore precisely,
  1587. X.BR (( ... ))
  1588. Xis equivalent to
  1589. X.B let
  1590. X\fB"\fP...\fB"\fP.
  1591. X.SH "CONDITIONAL EXPRESSIONS"
  1592. XA \fIconditional expression\fP is used with the
  1593. X.B [[
  1594. Xcompound command to test attributes of files and to compare strings.
  1595. XEach expression can be constructed from one or more
  1596. Xof the following unary or binary expressions:
  1597. X.PD 0
  1598. X.TP
  1599. X\fB\-a\fP \fIfile\fP
  1600. Xtrue if
  1601. X.I file
  1602. Xexists.
  1603. X.TP
  1604. X\fB\-b\fP \fIfile\fP
  1605. Xtrue if
  1606. X.I file
  1607. Xexists and is a block special file.
  1608. X.TP
  1609. X\fB\-c\fP \fIfile\fP
  1610. Xtrue if
  1611. X.I file
  1612. Xexists and is a character special file.
  1613. X.TP
  1614. X\fB\-d\fP \fIfile\fP
  1615. Xtrue if
  1616. X.I file
  1617. Xexists and is a directory.
  1618. X.TP
  1619. X\fB\-e\fP \fIfile\fP
  1620. Xtrue if
  1621. X.I file
  1622. Xexists.
  1623. X.TP
  1624. X\fB\-f\fP \fIfile\fP
  1625. Xtrue if
  1626. X.I file
  1627. Xexists and is an ordinary file.
  1628. X.TP
  1629. X\fB\-g\fP \fIfile\fP
  1630. Xtrue if
  1631. X.I file
  1632. Xexists and is has its setgid bit set.
  1633. X.TP
  1634. X\fB\-h\fP \fIfile\fP
  1635. Xtrue if
  1636. X.I file
  1637. Xexists and is a symbolic link.
  1638. X.TP
  1639. X\fB\-k\fP \fIfile\fP
  1640. Xtrue if
  1641. X.I file
  1642. Xexists and is has its sticky bit set.
  1643. X.TP
  1644. X\fB\-n\fP \fIstring\fP
  1645. Xtrue if length of
  1646. X.I string
  1647. Xis non-zero.
  1648. X.TP
  1649. X\fB\-o\fP \fIoption\fP
  1650. Xtrue if option named
  1651. X.I option
  1652. Xis on.
  1653. X.TP
  1654. X\fB\-p\fP \fIfile\fP
  1655. Xtrue if
  1656. X.I file
  1657. Xexists and is a fifo special file or a pipe.
  1658. X.TP
  1659. X\fB\-r\fP \fIfile\fP
  1660. Xtrue if
  1661. X.I file
  1662. Xexists and is readable by current process.
  1663. X.TP
  1664. X\fB\-s\fP \fIfile\fP
  1665. Xtrue if
  1666. X.I file
  1667. Xexists and has size greater than zero.
  1668. X.TP
  1669. X\fB\-t\fP \fIfd\fP
  1670. Xtrue if file descriptor number
  1671. X.I fd
  1672. Xis open and associated with a terminal device.
  1673. X(note: \fIfd\fP is not optional)
  1674. X.TP
  1675. X\fB\-u\fP \fIfile\fP
  1676. Xtrue if
  1677. X.I file
  1678. Xexists and is has its setuid bit set.
  1679. X.TP
  1680. X\fB\-w\fP \fIfile\fP
  1681. Xtrue if
  1682. X.I file
  1683. Xexists and is writable by current process.
  1684. X.TP
  1685. X\fB\-x\fP \fIfile\fP
  1686. Xtrue if
  1687. X.I file
  1688. Xexists and is executable by current process.
  1689. XIf
  1690. X.I file
  1691. Xexists and is a directory, then the current process
  1692. Xhas permission to search in the directory.
  1693. X.TP
  1694. X\fB\-z\fP \fIstring\fP
  1695. Xtrue if length of
  1696. X.I string
  1697. Xis zero.
  1698. X.TP
  1699. X\fB\-L\fP \fIfile\fP
  1700. Xtrue if
  1701. X.I file
  1702. Xexists and is a symbolic link.
  1703. X.TP
  1704. X\fB\-O\fP \fIfile\fP
  1705. Xtrue if
  1706. X.I file
  1707. Xexists and is owned by the effective user id of this process.
  1708. X.TP
  1709. X\fB\-G\fP \fIfile\fP
  1710. Xtrue if
  1711. X.I file
  1712. Xexists and its group matches the effective group id of this process.
  1713. X.TP
  1714. X\fB\-S\fP \fIfile\fP
  1715. Xtrue if
  1716. X.I file
  1717. Xexists and is a socket.
  1718. X.TP
  1719. X\fIfile1\fP \fB\-nt\fP \fIfile2\fP
  1720. Xtrue if
  1721. X.I file1
  1722. Xexists and is newer than
  1723. X.IR file2 .
  1724. X.TP
  1725. X\fIfile1\fP \fB\-ot\fP \fIfile2\fP
  1726. Xtrue if
  1727. X.I file1
  1728. Xexists and is older than
  1729. X.IR file2 .
  1730. X.TP
  1731. X\fIfile1\fP \fB\-ef\fP \fIfile2\fP
  1732. Xtrue if
  1733. X.I file1
  1734. Xand 
  1735. X.I file2
  1736. Xexist and refer to the same file.
  1737. X.TP
  1738. X\fIstring\fP \fB=\fP \fIpattern\fP
  1739. Xtrue if
  1740. X.I string
  1741. Xmatches
  1742. X.IR pattern .
  1743. X.TP
  1744. X\fIstring\fP \fB!=\fP \fIpattern\fP
  1745. Xtrue if
  1746. X.I string
  1747. Xdoes not match
  1748. X.IR pattern .
  1749. X.TP
  1750. X\fIstring1\fP \fB<\fP \fIstring2\fP
  1751. Xtrue if
  1752. X.I string1
  1753. Xcomes before
  1754. X.I string2
  1755. Xbased on ASCII value of their characters.
  1756. X.TP
  1757. X\fIstring1\fP \fB>\fP \fIstring2\fP
  1758. Xtrue if
  1759. X.I string1
  1760. Xcomes after
  1761. X.I string2
  1762. Xbased on ASCII value of their characters.
  1763. X.TP
  1764. X\fIexp1\fP \fB\-eq\fP \fIexp2\fP
  1765. Xtrue if
  1766. X.I exp1
  1767. Xis equal to
  1768. X.IR exp2.
  1769. X.TP
  1770. X\fIexp1\fP \fB\-ne\fP \fIexp2\fP
  1771. Xtrue if
  1772. X.I exp1
  1773. Xis not equal to
  1774. X.IR exp2.
  1775. X.TP
  1776. X\fIexp1\fP \fB\-lt\fP \fIexp2\fP
  1777. Xtrue if
  1778. X.I exp1
  1779. Xis less than
  1780. X.IR exp2.
  1781. X.TP
  1782. X\fIexp1\fP \fB\-gt\fP \fIexp2\fP
  1783. Xtrue if
  1784. X.I exp1
  1785. Xis greater than
  1786. X.IR exp2.
  1787. X.TP
  1788. X\fIexp1\fP \fB\-le\fP \fIexp2\fP
  1789. Xtrue if
  1790. X.I exp1
  1791. Xis less than or equal to
  1792. X.IR exp2.
  1793. X.TP
  1794. X\fIexp1\fP \fB\-ge\fP \fIexp2\fP
  1795. Xtrue if
  1796. X.I exp1
  1797. Xis greater than or equal to
  1798. X.IR exp2.
  1799. X.TP
  1800. X\fB(\fP \fIexp\fP \fB)\fP
  1801. Xtrue if \fIexp\fP is true.
  1802. X.TP
  1803. X\fB!\fP \fIexp\fP
  1804. Xtrue if \fIexp\fP is false.
  1805. X.TP
  1806. X\fIexp1\fP \fB&&\fP \fIexp2\fP
  1807. Xtrue if \fIexp1\fP and \fIexp2\fP are both true.
  1808. X.TP
  1809. X\fIexp1\fP \fB|\||\fP \fIexp2\fP
  1810. Xtrue if either \fIexp1\fP or \fIexp2\fP is true.
  1811. X.PD
  1812. X.PP
  1813. XIn each of the above expressions, if
  1814. X.I file
  1815. Xis of the form
  1816. X\fB/dev/fd/\fP\fIn\fR,
  1817. Xwhere
  1818. X.I n
  1819. Xis an integer,
  1820. Xthen the test applied to the open file whose
  1821. Xdescriptor number is
  1822. X.IR n ,
  1823. Xeven if the underlying system does not support
  1824. Xthe \fB/dev/fd\fP directory.
  1825. X.PD
  1826. X.SH "ZSH LINE EDITOR"
  1827. XIf the \fBZLE\fP option is set (it is by default)
  1828. Xand the shell input is attached to the terminal, the user
  1829. Xis allowed to edit command lines.
  1830. X.PP
  1831. XThere are two display modes.  The first, multiline mode, is the default.
  1832. XIt only works if the \fBTERM\fP parameter is set to a valid
  1833. Xterminal type that can move the cursor up.  The second,
  1834. Xsingle line mode, is used if \fBTERM\fP is invalid or incapable
  1835. Xof moving the cursor up, or if the \fBSINGLE_LINE_ZLE\fP
  1836. Xoption is set.  This mode is similar to ksh, and uses no
  1837. Xtermcap sequences.
  1838. X.SS Bindings
  1839. XCommand bindings may be set using the \fBbindkey\fP builtin.
  1840. XThere are two keymaps\-the main keymap and the alternate keymap.
  1841. XThe alternate keymap is bound to vi command mode.
  1842. XThe main keymap is bound to emacs mode by default.
  1843. XTo bind the main keymap to vi insert mode, use 
  1844. X\fBbindkey \-v\fP, or set one of the \fBVISUAL\fP or \fBEDITOR\fP
  1845. Xenvironment variables to a string containing \fBvi\fP.
  1846. X.PP
  1847. XThe following is a list of all the key commands
  1848. Xand their default bindings in emacs and vi command mode.
  1849. X.SS Movement
  1850. X.TP
  1851. X\fBvi-backward-blank-word\fP (unbound) (B)
  1852. XMove backward one word, where a word is defined as a series of
  1853. Xnon-blank characters.
  1854. X.TP
  1855. X\fBbackward-char\fP (^B ESC-[D) (\|)
  1856. XMove backward one character.
  1857. X.TP
  1858. X\fBvi-backward-char\fP (\|) (h)
  1859. XMove backward one character, without changing lines.
  1860. X.TP
  1861. X\fBbackward-word\fP (ESC-B ESC-b) (unbound)
  1862. XMove to the beginning of the previous word.
  1863. X.TP
  1864. X\fBemacs-backward-word\fP
  1865. XMove to the beginning of the previous word.
  1866. X.TP
  1867. X\fBvi-backward-word\fP (unbound) (b)
  1868. XMove to the beginning of the previous word, vi-style.
  1869. X.TP
  1870. X\fBbeginning-of-line\fP (^A) (0)
  1871. XMove to the beginning of the line.  If already at the beginning
  1872. Xof the line, move to the beginning of the previous line, if any.
  1873. X.TP
  1874. X\fBvi-beginning-of-line\fP
  1875. XMove to the beginning of the line, without changing lines.
  1876. X.TP
  1877. X\fBend-of-line\fP (^E)
  1878. XMove to the end of the line.  If already at the end 
  1879. Xof the line, move to the end of the next line, if any.
  1880. X.TP
  1881. X\fBvi-end-of-line\fP (unbound) ($)
  1882. XMove to the end of the line.
  1883. X.TP
  1884. X\fBvi-forward-blank-word\fP (unbound) (W)
  1885. XMove forward one word, where a word is defined as a series of
  1886. Xnon-blank characters.
  1887. X.TP
  1888. X\fBvi-forward-blank-word-end\fP (unbound) (E)
  1889. XMove to the end of the current word,
  1890. Xor, if at the end of the current word,
  1891. Xto the end of the next word,
  1892. Xwhere a word is defined as a series of
  1893. Xnon-blank characters.
  1894. X.TP
  1895. X\fBforward-char\fP (^F ESC-[C)
  1896. XMove forward one character.
  1897. X.TP
  1898. X\fBvi-forward-char\fP (unbound) (space l)
  1899. XMove forward one character.
  1900. X.TP
  1901. X\fBvi-find-next-char\fP (^X^F) (f)
  1902. XRead a character from the keyboard, and move to
  1903. Xthe next occurrence of it in the line.
  1904. X.TP
  1905. X\fBvi-find-next-char-skip\fP (unbound) (t)
  1906. SHAR_EOF
  1907. true || echo 'restore of zsh2.2/man/man1/zsh.1 failed'
  1908. fi
  1909. echo 'End of zsh2.2 part 3'
  1910. echo 'File zsh2.2/man/man1/zsh.1 is continued in part 4'
  1911. echo 4 > _shar_seq_.tmp
  1912. exit 0
  1913.  
  1914. exit 0 # Just in case...
  1915.